package com.amap.flutter.map.overlays.polygon;

import com.t3map.api.map.model.T3LatLng;
import com.t3map.api.map.model.T3PolygonOptions;

import java.util.List;

/**
 * @author whm
 * @date 2020/11/12 9:51 AM
 * @mail hongming.whm@alibaba-inc.com
 * @since
 */
class PolygonOptionsBuilder implements PolygonOptionsSink {
    final T3PolygonOptions polygonOptions;
    PolygonOptionsBuilder() {
        polygonOptions = new T3PolygonOptions();
        //必须设置为true，否则会出现线条转折处出现断裂的现象
        polygonOptions.usePolylineStroke(true);
    }

    public T3PolygonOptions build(){
        return polygonOptions;
    }


    @Override
    public void setPoints(List<T3LatLng> points) {
        polygonOptions.setPoints(points);
    }

    @Override
    public void setStrokeWidth(float strokeWidth) {
        polygonOptions.strokeWidth(strokeWidth);
    }

    @Override
    public void setStrokeColor(int color) {
        polygonOptions.strokeColor(color);
    }

    @Override
    public void setFillColor(int color) {
        polygonOptions.fillColor(color);
    }

    @Override
    public void setVisible(boolean visible) {
        polygonOptions.visible(visible);
    }
}
